package no.sachmuld.methodcombination.examples.annotation.strategy.v2;

import no.sachmuld.methodcombination.api.MethodInvocation;

/**
 *
 */
public class RubberDuck extends Duck {

    public RubberDuck() {

        final FlyNoWay fly = new FlyNoWay();
        final Squeak squeak = new Squeak();

        with(new DuckBehaviour() {
            @Override
            public void fly(MethodInvocation<Void> methodInvocation) {
                fly.fly();
            }

            @Override
            public void quack(MethodInvocation<Void> methodInvocation) {
                squeak.quack();
            }
        });
    }
}
